import string, sys, os

import init
from cmd_ import * 

def main(argv):
    
    try:
        base = argv[1]
    except:
        sys.stderr.write ("Usage: " + str(sys.argv[0]) + " [data_folder]\n")
        sys.exit(1)
    
    # loading of a data folder
    if os.access(base,os.W_OK)==1:
        os.chdir(base)  
    
    #loading of a config file
    configdict = init.load_configfile('frac.conf')     
            
    # start a command line interface
    cli = CLI(base,configdict)
    cli.cmdloop()


if __name__ == "__main__":
    main(sys.argv)

